package config

const (
	StrategyTraffic  = "traffic"
	StrategyCache    = "cache"
	StrategyGrey     = "grey"
	StrategyFuse     = "fuse"
	StrategyVisit    = "visit"
	StrategyDataMask = "data-mask"

	StrategyTrafficApintoConfName  = "limiting"
	StrategyCacheApintoConfName    = "valid_time"
	StrategyGreyApintoConfName     = "grey"
	StrategyFuseApintoConfName     = "fuse"
	StrategyVisitApintoConfName    = "visit"
	StrategyDataMaskApintoConfName = "data_mask"

	StrategyTrafficRuntimeKind  = "strategy_traffic"
	StrategyCacheRuntimeKind    = "strategy_cache"
	StrategyGreyRuntimeKind     = "strategy_grey"
	StrategyVisitRuntimeKind    = "strategy_visit"
	StrategyFuseRuntimeKind     = "strategy_fuse"
	StrategyDataMaskRuntimeKind = "strategy_data_mask"

	StrategyTrafficBatchName  = "strategies-limiting"
	StrategyCacheBatchName    = "strategies-cache"
	StrategyGreyBatchName     = "strategies-grey"
	StrategyFuseBatchName     = "strategies-fuse"
	StrategyVisitBatchName    = "strategies-visit"
	StrategyDataMaskBatchName = "strategies-data_mask"

	FilterApplication = "application"
	FilterApi         = "api"
	FilterPath        = "path"
	FilterService     = "service"
	FilterMethod      = "method"
	FilterIP          = "ip"
	FilterAppKey      = "appkey"
	FilterTime        = "time"

	FilterTypeRemote  = "remote"
	FilterTypePattern = "pattern"
	FilterTypeStatic  = "static"

	FilterValuesALL = "ALL"
	ApiPathRegexp   = `^\*?[\w-/]+\*?$`

	//灰度策略分配方式
	GreyDistributionPercent = "percent"
	GreyDistributionMatch   = "match"

	//访问策略访问规则
	VisitRuleAllow  = "allow"
	VisitRuleRefuse = "refuse"

	//熔断策略字符集
	CharsetUTF8  = "UTF-8"
	CharsetGBK   = "GBK"
	CharsetASCII = "ASCII"
)

var (
	strategyCharsets = []string{CharsetUTF8, CharsetGBK, CharsetASCII}
)

func GetStrategyCharsetList() []string {
	return strategyCharsets
}
